#! /usr/bin/php5
GtkWidget
	GtkCalendar
	GtkCellView
	GtkContainer
		GtkBin
			GtkAlignment
			GtkButton
				GtkColorButton
				GtkFontButton
				GtkToggleButton
					GtkCheckButton
						GtkRadioButton
			GtkComboBox
				GtkComboBoxEntry
			GtkEventBox
			GtkExpander
			GtkFrame
				GtkAspectFrame
			GtkHandleBox
			GtkItem
				GtkMenuItem
					GtkCheckMenuItem
						GtkRadioMenuItem
					GtkImageMenuItem
					GtkSeparatorMenuItem
					GtkTearoffMenuItem
			GtkScrolledWindow
			GtkToolItem
				GtkSeparatorToolItem
				GtkToolButton
					GtkMenuToolButton
					GtkToggleToolButton
						GtkRadioToolButton
			GtkViewport
			GtkWindow
				GtkDialog
					GtkAboutDialog
					GtkColorSelectionDialog
					GtkFileChooserDialog
					GtkFileSelection
					GtkFontSelectionDialog
					GtkInputDialog
					GtkMessageDialog
				GtkPlug
			GtkMozEmbed
		GtkBox
			GtkButtonBox
				GtkHButtonBox
				GtkVButtonBox
			GtkHBox
				GtkFileChooserButton
				GtkStatusbar
			GtkVBox
				GtkColorSelection
				GtkFileChooserWidget
				GtkFontSelection
				GtkGammaCurve
		GtkFixed
		GtkIconView
		GtkLayout
		GtkMenuShell
			GtkMenu
			GtkMenuBar
		GtkNotebook
		GtkPaned
			GtkHPaned
			GtkVPaned
		GtkSocket
		GtkTable
		GtkTextView
			GtkSourceView
		GtkToolbar
		GtkTreeView
	GtkDrawingArea
		GtkCurve
	GtkEntry
		GtkSpinButton
	GtkInvisible
	GtkMisc
		GtkArrow
		GtkImage
		GtkLabel
			GtkAccelLabel
	GtkProgress
		GtkProgressBar
	GtkRange
		GtkScale
			GtkHScale
			GtkVScale
		GtkScrollbar
			GtkHScrollbar
			GtkVScrollbar
	GtkRuler
		GtkHRuler
		GtkVRuler
	GtkSeparator
		GtkHSeparator
		GtkVSeparator
<?

$arrClasses[] = 'GtkWidget' ;
$arrClasses[] = 'GtkEventBox' ;
$arrClasses[] = 'GtkCalendar' ;
$arrClasses[] = 'GtkCellView' ;
$arrClasses[] = 'GtkContainer' ;
$arrClasses[] = 'GtkBin' ;
$arrClasses[] = 'GtkAlignment' ;
$arrClasses[] = 'GtkButton' ;
$arrClasses[] = 'GtkColorButton' ;
$arrClasses[] = 'GtkFontButton' ;
$arrClasses[] = 'GtkToggleButton' ;
$arrClasses[] = 'GtkCheckButton' ;
$arrClasses[] = 'GtkRadioButton' ;
$arrClasses[] = 'GtkComboBox' ;
$arrClasses[] = 'GtkComboBoxEntry' ;
$arrClasses[] = 'GtkEventBox' ;
$arrClasses[] = 'GtkExpander' ;
$arrClasses[] = 'GtkFrame' ;
$arrClasses[] = 'GtkAspectFrame' ;
$arrClasses[] = 'GtkHandleBox' ;
$arrClasses[] = 'GtkItem' ;
$arrClasses[] = 'GtkMenuItem' ;
$arrClasses[] = 'GtkCheckMenuItem' ;
$arrClasses[] = 'GtkRadioMenuItem' ;
$arrClasses[] = 'GtkImageMenuItem' ;
$arrClasses[] = 'GtkSeparatorMenuItem' ;
$arrClasses[] = 'GtkTearoffMenuItem' ;
$arrClasses[] = 'GtkScrolledWindow' ;
$arrClasses[] = 'GtkToolItem' ;
$arrClasses[] = 'GtkSeparatorToolItem' ;
$arrClasses[] = 'GtkToolButton' ;
$arrClasses[] = 'GtkMenuToolButton' ;
$arrClasses[] = 'GtkToggleToolButton' ;
$arrClasses[] = 'GtkRadioToolButton' ;
$arrClasses[] = 'GtkViewport' ;
$arrClasses[] = 'GtkWindow' ;
$arrClasses[] = 'GtkDialog' ;
$arrClasses[] = 'GtkAboutDialog' ;
$arrClasses[] = 'GtkColorSelectionDialog' ;
$arrClasses[] = 'GtkFileChooserDialog' ;
$arrClasses[] = 'GtkFileSelection' ;
$arrClasses[] = 'GtkFontSelectionDialog' ;
$arrClasses[] = 'GtkInputDialog' ;
$arrClasses[] = 'GtkMessageDialog' ;
$arrClasses[] = 'GtkPlug' ;
$arrClasses[] = 'GtkMozEmbed' ;
$arrClasses[] = 'GtkBox' ;
$arrClasses[] = 'GtkButtonBox' ;
$arrClasses[] = 'GtkHButtonBox' ;
$arrClasses[] = 'GtkVButtonBox' ;
$arrClasses[] = 'GtkHBox' ;
$arrClasses[] = 'GtkFileChooserButton' ;
$arrClasses[] = 'GtkStatusbar' ;
$arrClasses[] = 'GtkVBox' ;
$arrClasses[] = 'GtkColorSelection' ;
$arrClasses[] = 'GtkFileChooserWidget' ;
$arrClasses[] = 'GtkFontSelection' ;
$arrClasses[] = 'GtkGammaCurve' ;
$arrClasses[] = 'GtkFixed' ;
$arrClasses[] = 'GtkIconView' ;
$arrClasses[] = 'GtkLayout' ;
$arrClasses[] = 'GtkMenuShell' ;
$arrClasses[] = 'GtkMenu' ;
$arrClasses[] = 'GtkMenuBar' ;
$arrClasses[] = 'GtkNotebook' ;
$arrClasses[] = 'GtkPaned' ;
$arrClasses[] = 'GtkHPaned' ;
$arrClasses[] = 'GtkVPaned' ;
$arrClasses[] = 'GtkSocket' ;
$arrClasses[] = 'GtkTable' ;
$arrClasses[] = 'GtkTextView' ;
$arrClasses[] = 'GtkSourceView' ;
$arrClasses[] = 'GtkToolbar' ;
$arrClasses[] = 'GtkTreeView' ;
$arrClasses[] = 'GtkDrawingArea' ;
$arrClasses[] = 'GtkCurve' ;
$arrClasses[] = 'GtkEntry' ;
$arrClasses[] = 'GtkSpinButton' ;
$arrClasses[] = 'GtkInvisible' ;
$arrClasses[] = 'GtkMisc' ;
$arrClasses[] = 'GtkArrow' ;
$arrClasses[] = 'GtkImage' ;
$arrClasses[] = 'GtkLabel' ;
$arrClasses[] = 'GtkAccelLabel' ;
$arrClasses[] = 'GtkProgress' ;
$arrClasses[] = 'GtkProgressBar' ;
$arrClasses[] = 'GtkRange' ;
$arrClasses[] = 'GtkScale' ;
$arrClasses[] = 'GtkHScale' ;
$arrClasses[] = 'GtkVScale' ;
$arrClasses[] = 'GtkScrollbar' ;
$arrClasses[] = 'GtkHScrollbar' ;
$arrClasses[] = 'GtkVScrollbar' ;
$arrClasses[] = 'GtkRuler' ;
$arrClasses[] = 'GtkHRuler' ;
$arrClasses[] = 'GtkVRuler' ;
$arrClasses[] = 'GtkSeparator' ;
$arrClasses[] = 'GtkHSeparator' ;
$arrClasses[] = 'GtkVSeparator' ;


foreach($arrClasses as $nIdx=>$sClass)
{
		$sOut = "<?
/*-- Project Introduce --*/

include_once(dirname(__FILE__).'/inc.PATH.php') ;

JCAT_Package::ImportClass('JCAT_UIGtkGladeWidgetCompilerBase',JCAT::PACKAGE_UIGTK) ;

/**
 * What's this Class ?
 *
 * @author		alee
 * @access		public
 */
class JCAT_UIGtkGladeWidgetCompiler_{$sClass} extends JCAT_UIGtkGladeWidgetCompilerBase
{


	/**
	 * 编译窗体创建代码
	 * 
	 * @access	public
	 * @param	\$aObject	JCAT_UIGtkGladeWidget	Widget对象
	 * @return	string
	 */
	protected function _CompileCreateWidget( JCAT_UIGtkGladeWidget \$aObject )
	{
		\$sWidgetClass = \$aObject->GetWidgetClass() ;
		\$sVariableName = '$'.JCAT_UIGtkGlade::GetWidgetVariableName(\$aObject) ;
		
		\$sCompiled = \"\\t\\t{\$sVariableName} = new {\$sWidgetClass}() ;\\r\\n\" ;
		
		
		return \$sCompiled ;
	}



	/**
	 * 编译子窗体并加入到父窗体
	 * 
	 * @access	public
	 * @param	\$aParentWidget		JCAT_UIGtkGladeWidget			父窗体
	 * @param	\$aChildWidget		JCAT_UIGtkGladeWidget			子窗体
	 * @param	\$aPacking			_JCAT_UIGtkGladeWidgetPacking	打包方式
	 * @static	
	 * @return	void
	 */
	protected function _CompileChildWidgetPacking( JCAT_UIGtkGladeWidget \$aParentWidget,JCAT_UIGtkGladeWidget \$aChildWidget, _JCAT_UIGtkGladeWidgetPacking \$aPacking )
	{
		// 父/子 窗体变量名
		\$sParentVariableName = '$'.JCAT_UIGtkGlade::GetWidgetVariableName(\$aParentWidget) ;
		\$sChildWidgetVariableName = '$'.JCAT_UIGtkGlade::GetWidgetVariableName(\$aChildWidget) ;
		
		// 子窗体名
		\$sChildWidgetName = \$aChildWidget->GetWidgetId() ;

		\$sCompiled = \"\\r\\n\\t\\t{\$sChildWidgetVariableName} = self::GetWidget('{\$sChildWidgetName}',\\\$arrObjectForSignal) ;\\r\\n\" ;
		
		
		return \$sCompiled ;
	}


	/**
	 * 注册到处理器管理器
	 * 
	 * @access	public
	 * @param	\$aManager	JCAT_IUIObjectProcessorManager	处理器管理器
	 * @static
	 * @return	void
	 */
	static public function RegistorToProcessorManager( JCAT_IUIObjectProcessorManager \$aManager )
	{
		// 仅仅将类名注册到 处理器管理器中， 将创建实例 延迟到 使用时
		\$aManager->RegisterProcessor( str_replace('JCAT_UIGtkGladeWidgetCompiler_','',__CLASS__), __CLASS__ ) ;
	}


}

?>" ;

	file_put_contents("UIGtkGladeWidgetCompiler/class.JCAT_UIGtkGladeWidgetCompiler_{$sClass}.php",$sOut) ;
}

echo count($arrClasses) ;
?>